package com.sticktogether.photoreceiver;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class PhotoDatabase extends SQLiteOpenHelper {
	
	static final int DB_VERSION = 2; 

	public PhotoDatabase(Context context) {
		super(context, "photos", null, DB_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL("CREATE TABLE photos (album_id MEDIUMINT(8), path TEXT, time TEXT, istopicid TINYINT(1));");

	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		if(oldVersion <= 1) {
			db.execSQL("ALTER TABLE photos ADD istopicid TINYINT(1);");
		}
	}

}
